//
//  YHLayerDefine.h
//  ThunderWarriors
//
//  Created by mac on 12-12-23.
//
//

#ifndef ThunderWarriors_YHLayerDefine_h
#define ThunderWarriors_YHLayerDefine_h

typedef enum __GameLayerIdType__{
    GAME_LAYER_UNKNOWN,
    GAME_LAYER_LOGIN,
    GAME_LAYER_MAIN,
    GAME_LAYER_SETTING,
    GAME_LAYER_GAMEOVER,
    //add your layer id before max id.
    GAME_LAYER_LOADING,
    GAME_LAYER_MAX
}GameLayerIdType;

#define CREATE_FUNC_LAYER_WITHID(__TYPE__) \
static __TYPE__* createWithLayerId(GameLayerIdType layerId) \
{ \
__TYPE__ *pRet = new __TYPE__(); \
if (pRet && pRet->init()) \
{ \
pRet->autorelease();\
pRet->setLayerIdType(layerId);\
return pRet; \
} \
else \
{ \
if(pRet) delete pRet; \
pRet = NULL; \
return NULL; \
} \
}

#endif
